package co.yixiang.yshop.module.crm.controller.admin.crmindex.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Map;
import java.time.LocalDate;

@Schema(description = "管理后台 - 首页统计 Response VO")
@Data
@Builder
public class CrmIndexRespVO {

    @Schema(description = "需要跟进客户数量")
    private Long followCustomerCount;

    @Schema(description = "需要跟进商机数量")
    private Long followBusinessCount;

    @Schema(description = "需要跟进线索数量")
    private Long followCluesCount;

    @Schema(description = "即将到期等合同")
    private Long contractDueCount;

    @Schema(description = "即将到期等客户")
    private Long customerDueCount;

    @Schema(description = "待回款的合同")
    private Long contractReturnCount;

    @Schema(description = "我的发票")
    private Long myInvoiceCount;

    @Schema(description = "商品总数")
    private Long productCount;

    @Schema(description = "待审核等合同")
    private Long contractCheckCount;

    @Schema(description = "待审核等回款")
    private Long receivablesCheckCount;

    @Schema(description = "待审核等发票")
    private Long invoiceCheckCount;

    private BrieCountVO brieCountVO;
    
    // 新增统计字段
    @Schema(description = "总线索数")
    private Long totalCluesCount;
    
    @Schema(description = "今日新增线索数")
    private Long todayCluesCount;
    
    @Schema(description = "昨日新增线索数")
    private Long yesterdayCluesCount;
    
    @Schema(description = "跟进记录数")
    private Long followRecordCount;
    
    @Schema(description = "历史总花费")
    private BigDecimal totalExpenditure;
    
    @Schema(description = "日均消费")
    private BigDecimal dailyExpenditure;
    
    @Schema(description = "最高单日消费")
    private BigDecimal maxDailyExpenditure;
    
    // 线索分类统计
    @Schema(description = "渠道分布统计")
    private Map<String, Long> channelDistribution;
    
    @Schema(description = "收入分布统计")
    private Map<String, Long> incomeDistribution;
    
    @Schema(description = "学历分布统计")
    private Map<String, Long> educationDistribution;
    
    @Schema(description = "性别分布统计")
    private Map<String, Long> genderDistribution;
    
    @Schema(description = "婚姻状况分布统计")
    private Map<String, Long> marriageDistribution;
    
    @Schema(description = "年龄分布统计")
    private Map<String, Long> ageDistribution;

    // 最新余额统计
    @Schema(description = "最新账单日期")
    private LocalDate latestBillingDate;

    @Schema(description = "最新账单日期的正余额总计")
    private BigDecimal latestPositiveBalanceTotal;

}